package com.moon.interview.config;

import com.moon.interview.aop.LoginInterceptor;
import jakarta.annotation.Resource;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * 登录拦截器配置
 */
//@Configuration
//public class WebConfig implements WebMvcConfigurer {
//    @Resource
//    private LoginInterceptor loginInterceptor;
//
//    public void addInterceptors(InterceptorRegistry registry) {
//        registry.addInterceptor(loginInterceptor)
//                .addPathPatterns("/**")
//                .excludePathPatterns("/**/user/login","/**/user/registry","/**/error**")  // 不拦截的路径
//                .excludePathPatterns("/**/*.js", "/**/*.css", "/**/*.png", "/**/*.html"); //排除前端静态资源
//    }
//}
